package com.nullpointer.Login;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;

public class Login extends Activity implements OnClickListener{
	EditText et1,et2;
	Button Send;
	LinearLayout ll;
	//String s1="xxx";
	//String s2="yyy";
	SingleTon dbh;//database handler//
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ll=(LinearLayout) findViewById(R.id.ll);
        Send=(Button) findViewById(R.id.button1);
        et1=(EditText) findViewById(R.id.et1);
        et2=(EditText) findViewById(R.id.et2);
        dbh=SingleTon.getInstance();
        Send.setOnClickListener(this);
    }
	public void onClick(View v) {
		// TODO Auto-generated method stub
		String str1,str2;
		str1=et1.getText().toString();
		str2=et2.getText().toString();
		str1=str1.trim();
		str2=str2.trim();
		if(v==Send){
			dbh.sets1(str1);
			dbh.sets2(str2);
			Intent i= new Intent(this,Page2.class);
			startActivity(i);
			
		}else{
			Toast.makeText(getBaseContext(), "Somthing went wrong", Toast.LENGTH_LONG).show();
			Intent i= new Intent(this,Login.class);
			startActivity(i);

		}
		
	}
}